﻿using System;
using System.Collections.Generic;

using System.Text;

namespace DTO
{
    public class CreditCard : BaseDTO
    {
        public enum CardType
        {
            Visa = 1,
            MasterCard,
            AmericanExpress,
            Discover
        }

        public string CardHolder { get; set; }
        public string Number { get; set; }
        public DateTime Expired { get; set; }
        public CardType Type { get; set; }

        public override string ToString ()
        {
            string result = this.CardHolder + "<br />";
            result += this.Type.ToString() + " - " + this.Number + "<br />";
            result += "Expires on " + this.Expired.ToString("D") + "<br />";
            return result;
        }

        public static CreditCard Sample ()
        {
            return new CreditCard()
            {
                CardHolder = "Thi Nguyen",
                Number = "XXXXXXXXXXXX1312",
                Expired = DateTime.Parse("05/01/2015"),
                Type = CardType.Visa
            };
        }
    }
}
